/*
 * PlayScenarioPanel.h
 *
 *  Created on: Oct 24, 2011
 *      Author: gonzalo
 */

#ifndef PLAYSCENARIOPANEL_H_
#define PLAYSCENARIOPANEL_H_

#include "WidgetMovimientoContainer.h"
#include "../../Server/SpaceBattleInterface.h"
#include "ShipStatus.h"
#include "Ship.h"
#include "Button.h"
#include "../BonusGenerator.h"

class PlayScenarioPanel: public WidgetMovimientoContainer{
private:
	std::string owner;

	BonusGenerator* bonusGenerator;

	int height;
	int width;
	Button* quitButton;
	bool esAdmin;
	int ultimoIdAsteroide;
	SpaceBattleInterface* interface;
	Label* lblGameover;
	Timer timer_gameover;

public:

	PlayScenarioPanel(int xPos, int yPos, Widget* parent,SpaceBattleInterface* interface, bool esAdmin);

	void addAsteroides(std::list<Asteroide*> asteroidesList);

	void addAmmo(ammoTypeEnum type);

	bool isAdmin();

	void addPlayer(ShipStatus* newShip);
	ShipStatus* getShipStatus();
	SpaceBattleInterface* getInterface();

	virtual void showOn(SDL_Surface* surface);
	virtual void handleEvent(Event event);
	virtual void resolve();

    int getHeight() const;
    int getWidth() const;
    std::string getOwner();
    void createAsteroid(DTOAsteroide* asteroid);
    void updateAsteroid(DTOAsteroide* asteroid);
    void resolveOverlaping(DTOShipStatus* dtoShipStatus);
    void gameover(bool lose);

	virtual ~PlayScenarioPanel();
    int getUltimoIdAsteroide();
    int getUltimoIdAsteroideConst();

    void setNewPosWidgetMov(WidgetMovimiento* widgetMov);

    Ship* getPlayerShip(bool blankShip = false);
};

#endif /* PLAYSCENARIOPANEL_H_ */
